#ifndef BALL_H
#define BALL_H


#include "usefulMethods.h"

class Ball
{
	public:
		Ball();
		Ball(Vector3 pos);
		Ball(Ball *b);

		//Draws the timer above the ball
		void renderTimer();

		//Decrements the time till ball is no longer hit
		//and returns wether the timer should reactivate
		bool decTimer();
		
		//Sets the value of the timer
		void startTimer();
		
		//Draws the Ball
		void draw();

		//Sets up the ball's display list
		static void setupDisplayList();
		
		// Update position
		void updatePosition( double elapsedTime );

		//Checks ball to ball collision
		bool resolveCollision(Ball ball, float &closeCollision, Vector3 &nextVelocity, Vector3 &newNextPosition, Vector3 &newCurPos, Vector3 nextPos, double &maxTime, double timeFromStart);

		//Gets your next Position
		Vector3 getNextPosition(double elapsedTime);

		// Set position
		void setPosition( const Vector3 & );
		// Get position
		Vector3 getPosition();

		// Set velocity
		void setVelocity( const Vector3 & );
		// Get velocity
		Vector3 getVelocity();

		// Color the ball
		void lightBall( float * );

		void DrawWarpZone();

		//Wether the ball is hit or not
		bool ballHit;

		static int numBallsLeft;
		static int angle;
		double rollAngle;
		bool aboveFloor;

		static GLuint index;
	protected:
		Vector3 position;
		Vector3 velocity;
		//Amount of time left on timer
		int timeTillNotHit;
		//Contains the display list
		
};


#endif